package com.example.demo.huawei;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main41 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // ABC<c89%000<
        // 输出
        // ABC<c89%000<
        // Aa1<2#<3$
        String line = sc.nextLine();
        isValid(line);
    }


    static void isValid(String password) {
        // 处理退格
        char[] charArray = password.toCharArray();
        List<Character> list = new ArrayList<>();
//         手动迭代数组并添加到 ArrayList
        for (char c : charArray) {
            list.add(c);
        }

//                 找到需要移除掉的索引
        List<Integer> needRemovedIndex = new ArrayList<>();
        for (int i = 0; i < list.size(); i++) {
            if (i > 0 && charArray[i] == '<') {
                //                list.remove(i - 1); // 影响数组长度 导致长度少1 最后一个字符是<就没发迭代到了
                needRemovedIndex.add(i - 1);
            }
        }
        // 进行移除
        List<Character> list2 = new ArrayList<>();
        for (int i = 0; i < list.size(); i++) {
            if (!needRemovedIndex.contains(i) && list.get(i) != '<') {
                list2.add(list.get(i));
            }
        }

        //        上面优化进行<自身没办法去除
//        for (int i = 0; i < charArray.length; i++) {
//            if (charArray[i] == '<' && !list2.isEmpty()) {
//                list2.remove(charArray[i - 1]);
//            } else {
//                list2.add(charArray[i]);
//            }
//        }
        boolean hasUpper = false;
        boolean hasLower = false;
        boolean hasDigit = false;
        boolean hasSpecial = false;
        for (Character c : list2) {
            if (Character.isUpperCase(c)) {
                hasUpper = true;
                break;
            }
        }
        for (Character c : list2) {
            if (Character.isLowerCase(c)) {
                hasLower = true;
                break;
            }
        }
        for (Character c : list2) {
            if (Character.isDigit(c)) {
                hasDigit = true;
                break;
            }

        }
        for (Character c : list2) {
            if (Character.isDigit(c) || Character.isLetter(c)) {
                continue;
            }
            hasSpecial = true;
            break;
        }
        StringBuilder sb = new StringBuilder();
        for (Character c : list2) {
            sb.append(c);
        }
        sb.append(",");
        sb.append(list2.size() >= 8 && hasUpper && hasLower && hasDigit && hasSpecial);
        System.out.println(sb.toString());

    }
}



